.class public Lweibo4android/Emotion;
.super Lweibo4android/WeiboResponse;
.source "Emotion.java"


# static fields
.field private static final serialVersionUID:J = -0x38dace4acbf8735eL


# instance fields
.field private category:Ljava/lang/String;

.field private is_common:Z

.field private is_hot:Z

.field private order_number:I

.field private phrase:Ljava/lang/String;

.field private type:Ljava/lang/String;

.field private url:Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 79
    invoke-direct {p0}, Lweibo4android/WeiboResponse;-><init>()V

    .line 80
    return-void
.end method

.method public constructor <init>(Lweibo4android/http/Response;)V
    .locals 5
    .parameter "res"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lweibo4android/WeiboException;
        }
    .end annotation

    .prologue
    .line 33
    invoke-direct {p0, p1}, Lweibo4android/WeiboResponse;-><init>(Lweibo4android/http/Response;)V

    .line 34
    invoke-virtual {p1}, Lweibo4android/http/Response;->asJSONObject()Lweibo4android/org/json/JSONObject;

    move-result-object v1

    .line 36
    .local v1, json:Lweibo4android/org/json/JSONObject;
    :try_start_0
    const-string v2, "phrase"

    invoke-virtual {v1, v2}, Lweibo4android/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    iput-object v2, p0, Lweibo4android/Emotion;->phrase:Ljava/lang/String;

    .line 37
    const-string v2, "type"

    invoke-virtual {v1, v2}, Lweibo4android/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    iput-object v2, p0, Lweibo4android/Emotion;->type:Ljava/lang/String;

    .line 38
    const-string v2, "url"

    invoke-virtual {v1, v2}, Lweibo4android/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    iput-object v2, p0, Lweibo4android/Emotion;->url:Ljava/lang/String;

    .line 39
    const-string v2, "is_hot"

    invoke-virtual {v1, v2}, Lweibo4android/org/json/JSONObject;->getBoolean(Ljava/lang/String;)Z

    move-result v2

    iput-boolean v2, p0, Lweibo4android/Emotion;->is_hot:Z

    .line 40
    const-string v2, "order_number"

    invoke-virtual {v1, v2}, Lweibo4android/org/json/JSONObject;->getInt(Ljava/lang/String;)I

    move-result v2

    iput v2, p0, Lweibo4android/Emotion;->order_number:I

    .line 41
    const-string v2, "category"

    invoke-virtual {v1, v2}, Lweibo4android/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    iput-object v2, p0, Lweibo4android/Emotion;->category:Ljava/lang/String;

    .line 42
    const-string v2, "is_common"

    invoke-virtual {v1, v2}, Lweibo4android/org/json/JSONObject;->getBoolean(Ljava/lang/String;)Z

    move-result v2

    iput-boolean v2, p0, Lweibo4android/Emotion;->is_common:Z
    :try_end_0
    .catch Lweibo4android/org/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    .line 47
    return-void

    .line 43
    :catch_0
    move-exception v0

    .line 44
    .local v0, je:Lweibo4android/org/json/JSONException;
    new-instance v2, Lweibo4android/WeiboException;

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Lweibo4android/org/json/JSONException;->getMessage()Ljava/lang/String;

    move-result-object v4

    invoke-static {v4}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v4, ":"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v1}, Lweibo4android/org/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3, v0}, Lweibo4android/WeiboException;-><init>(Ljava/lang/String;Ljava/lang/Exception;)V

    throw v2
.end method

.method public constructor <init>(Lweibo4android/org/json/JSONObject;)V
    .locals 4
    .parameter "json"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lweibo4android/WeiboException;
        }
    .end annotation

    .prologue
    .line 48
    invoke-direct {p0}, Lweibo4android/WeiboResponse;-><init>()V

    .line 50
    :try_start_0
    const-string v1, "phrase"

    invoke-virtual {p1, v1}, Lweibo4android/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lweibo4android/Emotion;->phrase:Ljava/lang/String;

    .line 51
    const-string v1, "type"

    invoke-virtual {p1, v1}, Lweibo4android/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lweibo4android/Emotion;->type:Ljava/lang/String;

    .line 52
    const-string v1, "url"

    invoke-virtual {p1, v1}, Lweibo4android/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lweibo4android/Emotion;->url:Ljava/lang/String;

    .line 53
    const-string v1, "is_hot"

    invoke-virtual {p1, v1}, Lweibo4android/org/json/JSONObject;->getBoolean(Ljava/lang/String;)Z

    move-result v1

    iput-boolean v1, p0, Lweibo4android/Emotion;->is_hot:Z

    .line 54
    const-string v1, "order_number"

    invoke-virtual {p1, v1}, Lweibo4android/org/json/JSONObject;->getInt(Ljava/lang/String;)I

    move-result v1

    iput v1, p0, Lweibo4android/Emotion;->order_number:I

    .line 55
    const-string v1, "category"

    invoke-virtual {p1, v1}, Lweibo4android/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lweibo4android/Emotion;->category:Ljava/lang/String;

    .line 56
    const-string v1, "is_common"

    invoke-virtual {p1, v1}, Lweibo4android/org/json/JSONObject;->getBoolean(Ljava/lang/String;)Z

    move-result v1

    iput-boolean v1, p0, Lweibo4android/Emotion;->is_common:Z
    :try_end_0
    .catch Lweibo4android/org/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    .line 61
    return-void

    .line 57
    :catch_0
    move-exception v0

    .line 58
    .local v0, je:Lweibo4android/org/json/JSONException;
    new-instance v1, Lweibo4android/WeiboException;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Lweibo4android/org/json/JSONException;->getMessage()Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, ":"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {p1}, Lweibo4android/org/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2, v0}, Lweibo4android/WeiboException;-><init>(Ljava/lang/String;Ljava/lang/Exception;)V

    throw v1
.end method

.method static constructEmotions(Lweibo4android/http/Response;)Ljava/util/List;
    .locals 8
    .parameter "res"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lweibo4android/http/Response;",
            ")",
            "Ljava/util/List",
            "<",
            "Lweibo4android/Emotion;",
            ">;"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lweibo4android/WeiboException;
        }
    .end annotation

    .prologue
    .line 64
    :try_start_0
    invoke-virtual {p0}, Lweibo4android/http/Response;->asJSONArray()Lweibo4android/org/json/JSONArray;

    move-result-object v3

    .line 65
    .local v3, list:Lweibo4android/org/json/JSONArray;
    invoke-virtual {v3}, Lweibo4android/org/json/JSONArray;->length()I

    move-result v4

    .line 66
    .local v4, size:I
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0, v4}, Ljava/util/ArrayList;-><init>(I)V

    .line 67
    .local v0, emotions:Ljava/util/List;,"Ljava/util/List<Lweibo4android/Emotion;>;"
    const/4 v1, 0x0

    .local v1, i:I
    :goto_0
    if-lt v1, v4, :cond_0

    .line 70
    return-object v0

    .line 68
    :cond_0
    new-instance v6, Lweibo4android/Emotion;

    invoke-virtual {v3, v1}, Lweibo4android/org/json/JSONArray;->getJSONObject(I)Lweibo4android/org/json/JSONObject;

    move-result-object v7

    invoke-direct {v6, v7}, Lweibo4android/Emotion;-><init>(Lweibo4android/org/json/JSONObject;)V

    invoke-interface {v0, v6}, Ljava/util/List;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catch Lweibo4android/org/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Lweibo4android/WeiboException; {:try_start_0 .. :try_end_0} :catch_1

    .line 67
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 71
    .end local v0           #emotions:Ljava/util/List;,"Ljava/util/List<Lweibo4android/Emotion;>;"
    .end local v1           #i:I
    .end local v3           #list:Lweibo4android/org/json/JSONArray;
    .end local v4           #size:I
    :catch_0
    move-exception v2

    .line 72
    .local v2, jsone:Lweibo4android/org/json/JSONException;
    new-instance v6, Lweibo4android/WeiboException;

    invoke-direct {v6, v2}, Lweibo4android/WeiboException;-><init>(Ljava/lang/Exception;)V

    throw v6

    .line 73
    .end local v2           #jsone:Lweibo4android/org/json/JSONException;
    :catch_1
    move-exception v5

    .line 74
    .local v5, te:Lweibo4android/WeiboException;
    throw v5
.end method


# virtual methods
.method public getCategory()Ljava/lang/String;
    .locals 1

    .prologue
    .line 134
    iget-object v0, p0, Lweibo4android/Emotion;->category:Ljava/lang/String;

    return-object v0
.end method

.method public getOrder_number()I
    .locals 1

    .prologue
    .line 126
    iget v0, p0, Lweibo4android/Emotion;->order_number:I

    return v0
.end method

.method public getPhrase()Ljava/lang/String;
    .locals 1

    .prologue
    .line 86
    iget-object v0, p0, Lweibo4android/Emotion;->phrase:Ljava/lang/String;

    return-object v0
.end method

.method public getType()Ljava/lang/String;
    .locals 1

    .prologue
    .line 94
    iget-object v0, p0, Lweibo4android/Emotion;->type:Ljava/lang/String;

    return-object v0
.end method

.method public getUrl()Ljava/lang/String;
    .locals 1

    .prologue
    .line 102
    iget-object v0, p0, Lweibo4android/Emotion;->url:Ljava/lang/String;

    return-object v0
.end method

.method public isIs_common()Z
    .locals 1

    .prologue
    .line 118
    iget-boolean v0, p0, Lweibo4android/Emotion;->is_common:Z

    return v0
.end method

.method public isIs_hot()Z
    .locals 1

    .prologue
    .line 110
    iget-boolean v0, p0, Lweibo4android/Emotion;->is_hot:Z

    return v0
.end method

.method public setCategory(Ljava/lang/String;)V
    .locals 0
    .parameter "category"

    .prologue
    .line 138
    iput-object p1, p0, Lweibo4android/Emotion;->category:Ljava/lang/String;

    .line 139
    return-void
.end method

.method public setIs_common(Z)V
    .locals 0
    .parameter "isCommon"

    .prologue
    .line 122
    iput-boolean p1, p0, Lweibo4android/Emotion;->is_common:Z

    .line 123
    return-void
.end method

.method public setIs_hot(Z)V
    .locals 0
    .parameter "isHot"

    .prologue
    .line 114
    iput-boolean p1, p0, Lweibo4android/Emotion;->is_hot:Z

    .line 115
    return-void
.end method

.method public setOrder_number(I)V
    .locals 0
    .parameter "orderNumber"

    .prologue
    .line 130
    iput p1, p0, Lweibo4android/Emotion;->order_number:I

    .line 131
    return-void
.end method

.method public setPhrase(Ljava/lang/String;)V
    .locals 0
    .parameter "phrase"

    .prologue
    .line 90
    iput-object p1, p0, Lweibo4android/Emotion;->phrase:Ljava/lang/String;

    .line 91
    return-void
.end method

.method public setType(Ljava/lang/String;)V
    .locals 0
    .parameter "type"

    .prologue
    .line 98
    iput-object p1, p0, Lweibo4android/Emotion;->type:Ljava/lang/String;

    .line 99
    return-void
.end method

.method public setUrl(Ljava/lang/String;)V
    .locals 0
    .parameter "url"

    .prologue
    .line 106
    iput-object p1, p0, Lweibo4android/Emotion;->url:Ljava/lang/String;

    .line 107
    return-void
.end method

.method public toString()Ljava/lang/String;
    .locals 2

    .prologue
    .line 142
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "Emotion [phrase="

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v1, p0, Lweibo4android/Emotion;->phrase:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, ", type="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lweibo4android/Emotion;->type:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, ", url="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 143
    iget-object v1, p0, Lweibo4android/Emotion;->url:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, ", is_hot="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-boolean v1, p0, Lweibo4android/Emotion;->is_hot:Z

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, ", is_common="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-boolean v1, p0, Lweibo4android/Emotion;->is_common:Z

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 144
    const-string v1, ", order_number="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget v1, p0, Lweibo4android/Emotion;->order_number:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, ", category="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 145
    iget-object v1, p0, Lweibo4android/Emotion;->category:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "]"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 142
    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method
